<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			body {
				perspective: 500px;/*全局透视*/
			}
			.wrap {
				margin: 200px auto;
				width: 500px;
				height: 500px;
				/* background-color: #EEEEEE; */
				display: flex;
				justify-content: space-around;
				align-items: center;
				border: 3px solid #FF6700;
				transform-style: preserve-3d;
				transform: rotateY(45deg);
			}
			.inner {
				width: 16.25rem;
				height: 260px;
				background-color: #FF6700;
				position: relative;
			}
			.inner::before {
				position: absolute;
				top: 0;left: 0;
				content: 'z轴-400px';
				display: block;
				width: 16.25rem;
				height: 260px;
				background-color: #41ad4a;
				z-index: -1;
				transform: translateZ(-400px);/*给z轴做偏移只能使用px*/
				color: #fff;
				text-align: center;
				font-size: 30px;
				line-height: 260px;
			}
			.inner::after {
				position: absolute;
				top: 0;left: 0;
				content: 'z轴 向前200px';
				display: block;
				width: 16.25rem;
				height: 260px;
				background-color: #ad2626;
				z-index: 1;
				transform: translateZ(200px);/*给z轴做偏移只能使用px*/
				color: #fff;
				text-align: center;
				font-size: 30px;
				line-height: 260px;
			}
			.wrap:hover .inner {
				
			}
		</style>
	</head>
	<body>
		<div class="wrap">
			<div class="inner"></div>
			
		</div>
	</body>
</html>
